package com.sea.app.module.identity.process;

import com.sea.app.module.identity.process.manager.ProcessUserEntityManager;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by 31417 on 2017/4/29.
 */
@Service
public class UserEntityManagerFactory implements SessionFactory {

    ProcessUserEntityManager processUserEntityManager;

    @Override
    public Class<?> getSessionType() {
        return ProcessUserEntityManager.class;
    }

    @Override
    public Session openSession() {
        return processUserEntityManager;
    }

    @Autowired
    public void setProcessUserEntityManager(ProcessUserEntityManager processUserEntityManager) {
        this.processUserEntityManager = processUserEntityManager;
    }
}
